﻿<%@ Page Language="C#" MasterPageFile="~/System/MasterPageTra.master" AutoEventWireup="true"
    CodeFile="TraStockList.aspx.cs" Inherits="Supervise_TraStockList" Title="Untitled Page" %>

<%@ Register Src="../System/DbPageFlip.ascx" TagName="DbPageFlip" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script language="vbscript" type="text/vbscript">
            Sub AreaSelect(byval id)
                Dim strReturnValue
	            strReturnValue = showModalDialog("../System/AreaSelect.aspx?ROOT=" & id,null,"dialogWidth:320px;dialogHeight:480px;status:0;scroll:no;center:yes;help:no;")
	            If Len(strReturnValue) > 0 Then
	                document.all("txtAreaId").value = Split(strReturnValue,vbCrLf)(0)
	                document.all("txtAreaName").value = Split(strReturnValue,vbCrLf)(1)
	            End If
            End Sub
    </script>

    <script language="vbscript" src="../Common/yz.vbs" type="text/vbscript"></script>

    <script language="javascript" src="../common/javascript/calendar.js" type="text/javascript">function Submit1_onclick() {
    </script>

    <script language="javascript" type="text/javascript">
    
        function Sel_PS(Type)
        {
      // window.alert(Type);
            window.open('TraCompany.aspx?Type='+Type);
        }
        function confirmvalue(obj)
        { 
            if (obj.type=='1')
            {
            document.all("txtAccountIdPS").value = obj.companyid;
            document.all("txtCompanyNamePS").value = obj.companyName;    
            }
            else if (obj.type=='2')
            {
            document.all("txtAccountIdSC").value = obj.companyid;
            document.all("txtCompanyNameSC").value = obj.companyName;    
            }
            else
            {
            document.all("txtAccountIdZB").value = obj.companyid;
            document.all("txtCompanyNameZB").value = obj.companyName;    
            }    
        }
        function Sel_YY()
        {
      //  window.alert("11");
         window.open('TraHospitalList.aspx');
        }
        function confirmvalue_YY(obj)
        { 
            document.all("txtHospitalName").value = obj.HospitalName;
            document.all("txtAccountIdYY").value =obj.AccountIdYY;        
        }
    </script>

    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td style="width: 4px">
                <img src="../images/intro_left.gif" width="4" height="34"></td>
            <td class="intro_wordbg">
                按采购单查询</td>
            <td background="../images/intro_bg.gif">
                <img src="../images/intro_right.jpg" width="118" height="34"></td>
        </tr>
    </table>
    <table id="tabData" width="98%" border="1" align="center" cellpadding="2" cellspacing="1">
        <tr>
            <td align="right">
                &nbsp;通用名：</td>
            <td>
                <asp:TextBox ID="txtProductName" runat="server" InvertedComma="通用名" Width="247px"></asp:TextBox></td>
            <td align="right" style="width: 106px">
                &nbsp;通用名：</td>
            <td>
                <asp:TextBox ID="TextBox1" runat="server" InvertedComma="通用名" Width="247px"></asp:TextBox>(精确)</td>
        </tr>
        <tr>
            <td align="right">
                商品流水号：</td>
            <td>
                <asp:TextBox ID="txtGoodsId" runat="server" InvertedComma="流水号" NumericOnly="流水号"  Width="249px"></asp:TextBox></td>
            <td align="right" style="width: 106px">
                药品类别：</td>
            <td>
                <asp:DropDownList ID="lstSort" runat="server" Width="249px">
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td align="right">
                &nbsp;<asp:CheckBox ID="chkUserPS" runat="server" Text="配送企业名称：" Width="112px" /></td>
            <td>
                <asp:Label ID="lab1" runat="server" Text="Label">
                <input id="txtCompanyNamePS" name="txtCompanyNamePS" type="text" invertedcomma="配送企业"
                    readonly value='<%= Request.Form["txtCompanyNamePS"]%>' />
                <input id="Button1" type="button" value="选择配送企业" class="button_bg6" onclick='Sel_PS(1)'
                    style="width: 90px" />
                <input id="txtAccountIdPS" name="txtAccountIdPS" type="hidden" style="width: 33px"
                    value='<%= Request.Form["txtAccountIdPS"] %>' /></asp:Label>&nbsp;</td>
            <td align="right" style="width: 106px">
                <asp:CheckBox ID="chkUserZB" runat="server" Text="中标人名称：" Width="100px" /></td>
            <td>
                <input id="txtCompanyNameZB" name="txtCompanyNameZB" type="text" invertedcomma="中标人名称"
                    readonly width="125px" value='<%= Request.Form["txtCompanyNameZB"] %>' />
                <input id="Button3" type="button" value="选择中标人" class="button_bg6" onclick='Sel_PS(3)'
                    style="width: 90px" />
                <input id="txtAccountIdZB" name="txtAccountIdZB" type="hidden" style="width: 13px"
                    value='<%= Request.Form["txtAccountIdZB"] %>' />
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:CheckBox ID="chkUserSC" runat="server" Text="生产企业名称：" /></td>
            <td>
                <input id="txtCompanyNameSC" name="txtCompanyNameSC" type="text" invertedcomma="生产企业"
                    readonly value='<%= Request.Form["txtCompanyNameSC"]%>' />
                <input id="Button2" type="button" value="选择生产企业" class="button_bg6" onclick='Sel_PS(2)'
                    style="width: 90px" />
                <input id="txtAccountIdSC" name="txtAccountIdSC" type="hidden" style="width: 23px"
                    value='<%= Request.Form["txtAccountIdSC"]%>' />
            </td>
            <td align="right" style="height: 28px; width: 106px;">
                <asp:CheckBox ID="chkUserYY" runat="server" Text="医院名称：" />&nbsp;</td>
            <td>
                <input id="txtHospitalName" name="txtHospitalName" type="text" invertedcomma="医院名称"
                    readonly style="display: <%=_strDisplay%>" value='<%= Request.Form["txtHospitalName"]%>' />
                <input id="Button4" type="button" value="选择医院" class="button_bg6" onclick='Sel_YY()'
                    style="width: 64px; display: <%=_strDisplay%>" />
                <input id="txtAccountIdYY" name="txtAccountIdYY" type="hidden" style="width: 13px"
                    value='<%= Request.Form["txtAccountIdYY"]%>' />
            </td>
        </tr>
        <tr>
            <td align="right">
                采购单名称：</td>
            <td style="height: 28px">
                <asp:TextBox ID="txtPlanName" runat="server" InvertedComma="采购单名称" Width="233px"></asp:TextBox>
            </td>
            <td align="right" style="width: 106px">
                采购单号：</td>
            <td>
                <asp:TextBox ID="txtBuyPlanId" runat="server" NumericOnly="采购单号" Width="185px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right">
                统计时间：</td>
            <td style="height: 28px">
                从<asp:TextBox ID="txtStartDate" runat="server" onclick="javascript:fPopCalendar(this,this);"
                    dataType="Date" format="ymd" require="true" DateTimeOnly="开始时间" NotNull='开始时间'
                    msg="日期不存在" Width="111px"></asp:TextBox>到<asp:TextBox ID="txtEndDate" runat="server"
                        onclick="javascript:fPopCalendar(this,this);" dataType="Date" format="ymd" require="true"
                        DateTimeOnly="结束时间" NotNull='结束时间' msg="日期不存在" Width="113px"></asp:TextBox><br />
                <span style="color: #ff0033">（请点击输入框点选时间）</span></td>
            <td align="right" style="width: 106px">
                采购状态：</td>
            <td>
                <asp:DropDownList ID="dealDrop" runat="server" Width="187px">
                    <asp:ListItem Value="0">未确认送货</asp:ListItem>
                    <asp:ListItem Value="1">送货中</asp:ListItem>
                    <asp:ListItem Selected="True" Value="2">已入库</asp:ListItem>
                    <asp:ListItem Value="4">无法配送</asp:ListItem>
                    <asp:ListItem Value="5">到期未送</asp:ListItem>
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td align="right" style="height: 26px">
                <asp:Label ID="Label1" runat="server" BorderStyle="None" Text="地区："></asp:Label>&nbsp;</td>
            <td style="height: 26px">
                <asp:Label ID="labArea" runat="server" BorderStyle="None" Text=""></asp:Label>&nbsp;</td>
            <td align="right" style="height: 26px; width: 106px;">
                &nbsp;&nbsp;
            </td>
            <td style="height: 26px">
                &nbsp;
                <asp:Button ID="Button5" runat="server" OnClick="Button5_Click" Text="" CssClass="button_Query"
                    OnClientClick="javascript:return CheckForm();" />
                &nbsp;
                <asp:Button ID="ToEcxul" runat="server" CssClass="button_bg4" OnClick="ToEcxul_Click"
                    Text="导出到Excel" Width="72px" /></td>
        </tr>
    </table>
    <asp:GridView ID="GridView1" runat="server" Width="98%" AutoGenerateColumns="False"
        CssClass='table_table' HeaderStyle-CssClass='table_title'  OnRowDataBound="GridView1_RowDataBound" ShowFooter="True">
        <Columns>
            <asp:BoundField DataField="areaname" HeaderText="地区" />
             <asp:BoundField DataField="BuyPlanId" HeaderText="采购单号" />
            <asp:BoundField DataField="UserCode_YY" HeaderText="医院编码" />
            <asp:BoundField DataField="HospitalName" HeaderText="医院名称" />
            <asp:BoundField DataField="PlanName" HeaderText="采购单名称" />
            <asp:TemplateField HeaderText="开始时间">
                <ItemTemplate>
                    <%# Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "StartTime")).ToShortDateString()%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="结束时间">
                <ItemTemplate>
                    <%# Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "EndTime")).ToShortDateString()%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="提交采购单时间">
                <ItemTemplate>
                    <%# DataBinder.Eval(Container.DataItem, "PurchasePlanDate")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="DGJE" HeaderText="订货金额（元）" />
            <asp:BoundField DataField="DHJE" HeaderText="送货金额（元）" />
             <asp:BoundField DataField="DealStatus" HeaderText="采购状态" />
            <asp:TemplateField HeaderText="医院详细">
                <ItemTemplate>
                    <a target="_blank" href='TraHospitalCompanyGoods.aspx?BuyPlanId=<%# DataBinder.Eval(Container.DataItem, "BuyPlanId")%>&AccountId_YY=<%# DataBinder.Eval(Container.DataItem, "AccountId_YY")%><%=_strParameter %>&deal=<%#DataBinder.Eval(Container.DataItem, "DealStatus") %>'>
                        医院详细</a>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <RowStyle CssClass="table_td" />
        <SelectedRowStyle CssClass="table_td" />
        <FooterStyle CssClass="table_td" />
        <HeaderStyle CssClass="table_title" />
    </asp:GridView>
    <br>
    <div align="right">
        <table border="0">
            <tr>
                <td style="height: 12px">
                    <input type="submit" name="butSelectAll" value="查看全部" class="button_bg6" style="width: 74px"
                        onclick="javascript:return CheckForm();" disabled="disabled" />
                </td>
                <td style="height: 12px">
                    <uc1:DbPageFlip ID="DbPageFlip1" runat="server" />
                </td>
            </tr>
        </table>
    </div>
    <asp:GridView ID="GridView2" runat="server">
    </asp:GridView>
</asp:Content>
